// Fill out your copyright notice in the Description page of Project Settings.


#include "Anim/Thid_Anim.h"
#include "Enemy/Enemy.h"

#include "GameFramework/CharacterMovementComponent.h"
#include "Kismet/KismetMathLibrary.h"


void UThid_Anim::NativeInitializeAnimation() {
	Super::NativeInitializeAnimation();
	ChixiaCharacter = Cast<AEnemy>(TryGetPawnOwner());
	if (ChixiaCharacter) {
		ChixiaCharacterMovement = ChixiaCharacter->GetCharacterMovement();
	}

}

void UThid_Anim::NativeUpdateAnimation(float DeltaTime) {
	Super::NativeUpdateAnimation(DeltaTime);
	ChixiaCharacter = Cast<AEnemy>(TryGetPawnOwner());
	if (ChixiaCharacterMovement) {
		Speed = UKismetMathLibrary::VSizeXY(ChixiaCharacterMovement->Velocity);
	}
}

